package site.wlwsjsx.iot_backend.entity;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import lombok.Getter;
import lombok.Setter;

import java.time.LocalDateTime;

/**
 * 工位环境数据表
 * 对应表：workstation_env
 */
@Data
@Getter
@Setter
public class WorkstationEnv {
    private Integer id;                  // 主键ID
    private String workstationCode;      // 工位编号
    private String curUsername;          // 使用者用户名
    private Integer powerStatus = 0;     // 电源状态，默认0
    private Integer lightStatus = 0;     // 灯光状态，默认0
    private Integer relayNum1Status = 0; // 1号继电器状态，默认0
    private Integer relayNum2Status = 0; // 2号继电器状态，默认0
    private Float heatScope;             // 热敏传感器检测值
    private Float lightIntensity;        // 光线传感器采集值
    private Float smokeScope;            // 烟雾传感器采集值
    private Float flameScope;            // 火焰传感器检测值
    private Float humidity;              // 湿度采集值
    private Float temperature;           // 温度采集值

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private LocalDateTime createTime;   // 创建/更新时间

    public WorkstationEnv() {
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getWorkstationCode() {
        return workstationCode;
    }

    public void setWorkstationCode(String workstationCode) {
        this.workstationCode = workstationCode;
    }

    public String getCurUsername() {
        return curUsername;
    }

    public void setCurUsername(String curUsername) {
        this.curUsername = curUsername;
    }

    public Integer getPowerStatus() {
        return powerStatus;
    }

    public void setPowerStatus(Integer powerStatus) {
        this.powerStatus = powerStatus;
    }

    public Integer getLightStatus() {
        return lightStatus;
    }

    public void setLightStatus(Integer lightStatus) {
        this.lightStatus = lightStatus;
    }

    public Integer getRelayNum1Status() {
        return relayNum1Status;
    }

    public void setRelayNum1Status(Integer relayNum1Status) {
        this.relayNum1Status = relayNum1Status;
    }

    public Integer getRelayNum2Status() {
        return relayNum2Status;
    }

    public void setRelayNum2Status(Integer relayNum2Status) {
        this.relayNum2Status = relayNum2Status;
    }

    public Float getLightIntensity() {
        return lightIntensity;
    }

    public void setLightIntensity(Float lightIntensity) {
        this.lightIntensity = lightIntensity;
    }

    public Float getSmokeScope() {
        return smokeScope;
    }

    public void setSmokeScope(Float smokeScope) {
        this.smokeScope = smokeScope;
    }

    public Float getFlameScope() {
        return flameScope;
    }

    public void setFlameScope(Float flameScope) {
        this.flameScope = flameScope;
    }

    public LocalDateTime getCreateTime() {
        return createTime;
    }

    public void setCreateTime(LocalDateTime createTime) {
        this.createTime = createTime;
    }

    public Float getHumidity() {
        return humidity;
    }

    public void setHumidity(Float humidity) {
        this.humidity = humidity;
    }

    public Float getTemperature() {
        return temperature;
    }

    public void setTemperature(Float temperature) {
        this.temperature = temperature;
    }

    public Float getHeatScope() {
        return heatScope;
    }

    public void setHeatScope(Float heatScope) {
        this.heatScope = heatScope;
    }

    @Override
    public String toString() {
        return "WorkstationEnv{" +
                "id=" + id +
                ", workstationCode='" + workstationCode + '\'' +
                ", curUsername='" + curUsername + '\'' +
                ", powerStatus=" + powerStatus +
                ", lightStatus=" + lightStatus +
                ", relayNum1Status=" + relayNum1Status +
                ", relayNum2Status=" + relayNum2Status +
                ", heatScope=" + heatScope +
                ", lightIntensity=" + lightIntensity +
                ", smokeScope=" + smokeScope +
                ", flameScope=" + flameScope +
                ", humidity=" + humidity +
                ", temperature=" + temperature +
                ", createTime=" + createTime +
                '}';
    }
}

